package HomeWork.AdvancedStream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;

/**
 * 用转换流进行写出字符串到文件
 */
public class Practice03 {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos=new FileOutputStream("osw.txt");
        OutputStreamWriter osw=new OutputStreamWriter(fos, StandardCharsets.UTF_8);
        osw.write("被这风吹散的人说他爱得不深,");
        osw.write("被这雨淋湿的人说他不会冷");
        System.out.println("Finished!");
        osw.close();
    }
}
